Optimal. Leaf size=103 \[ \frac {1}{2} x \left (a^2 (A+2 C)+2 A b^2\right )+\frac {a A b \sin (c+d x)}{d}+\frac {A \sin (c+d x) \cos (c+d x) (a+b \sec (c+d x))^2}{2 d}+\frac {2 a b C \tanh ^{-1}(\sin (c+d x))}{d}-\frac {b^2 (A-2 C) \tan (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.29, antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {4095, 4076, 4047, 8, 4045, 3770} \[ \frac {1}{2} x \left (a^2 (A+2 C)+2 A b^2\right )+\frac {a A b \sin (c+d x)}{d}+\frac {A \sin (c+d x) \cos (c+d x) (a+b \sec (c+d x))^2}{2 d}+\frac {2 a b C \tanh ^{-1}(\sin (c+d x))}{d}-\frac {b^2 (A-2 C) \tan (c+d x)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3770
Rule 4045
Rule 4047
Rule 4076
Rule 4095
Rubi steps
\begin {align*} \int \cos ^2(c+d x) (a+b \sec (c+d x))^2 \left (A+C \sec ^2(c+d x)\right ) \, dx &=\frac {A \cos (c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}+\frac {1}{2} \int \cos (c+d x) (a+b \sec (c+d x)) \left (2 A b+a (A+2 C) \sec (c+d x)-b (A-2 C) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {A \cos (c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}-\frac {b^2 (A-2 C) \tan (c+d x)}{2 d}+\frac {1}{2} \int \cos (c+d x) \left (2 a A b+\left (2 A b^2+a^2 (A+2 C)\right ) \sec (c+d x)+4 a b C \sec ^2(c+d x)\right ) \, dx\\ &=\frac {A \cos (c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}-\frac {b^2 (A-2 C) \tan (c+d x)}{2 d}+\frac {1}{2} \int \cos (c+d x) \left (2 a A b+4 a b C \sec ^2(c+d x)\right ) \, dx+\frac {1}{2} \left (2 A b^2+a^2 (A+2 C)\right ) \int 1 \, dx\\ &=\frac {1}{2} \left (2 A b^2+a^2 (A+2 C)\right ) x+\frac {a A b \sin (c+d x)}{d}+\frac {A \cos (c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}-\frac {b^2 (A-2 C) \tan (c+d x)}{2 d}+(2 a b C) \int \sec (c+d x) \, dx\\ &=\frac {1}{2} \left (2 A b^2+a^2 (A+2 C)\right ) x+\frac {2 a b C \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a A b \sin (c+d x)}{d}+\frac {A \cos (c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}-\frac {b^2 (A-2 C) \tan (c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.77, size = 130, normalized size = 1.26 \[ \frac {2 (c+d x) \left (a^2 (A+2 C)+2 A b^2\right )+\tan (c+d x) \left (a^2 A \cos (2 (c+d x))+a^2 A+4 b^2 C\right )+8 a A b \sin (c+d x)-8 a b C \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+8 a b C \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )}{4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.46, size = 119, normalized size = 1.16 \[ \frac {2 \, C a b \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - 2 \, C a b \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + {\left ({\left (A + 2 \, C\right )} a^{2} + 2 \, A b^{2}\right )} d x \cos \left (d x + c\right ) + {\left (A a^{2} \cos \left (d x + c\right )^{2} + 4 \, A a b \cos \left (d x + c\right ) + 2 \, C b^{2}\right )} \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.25, size = 175, normalized size = 1.70 \[ \frac {4 \, C a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 4 \, C a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {4 \, C b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1} + {\left (A a^{2} + 2 \, C a^{2} + 2 \, A b^{2}\right )} {\left (d x + c\right )} - \frac {2 \, {\left (A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 4 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 4 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2}}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.81, size = 120, normalized size = 1.17 \[ \frac {a^{2} A \cos \left (d x +c \right ) \sin \left (d x +c \right )}{2 d}+\frac {a^{2} A x}{2}+\frac {A \,a^{2} c}{2 d}+a^{2} C x +\frac {C \,a^{2} c}{d}+\frac {2 a A b \sin \left (d x +c \right )}{d}+\frac {2 C a b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+A x \,b^{2}+\frac {A \,b^{2} c}{d}+\frac {b^{2} C \tan \left (d x +c \right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.36, size = 99, normalized size = 0.96 \[ \frac {{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a^{2} + 4 \, {\left (d x + c\right )} C a^{2} + 4 \, {\left (d x + c\right )} A b^{2} + 4 \, C a b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 8 \, A a b \sin \left (d x + c\right ) + 4 \, C b^{2} \tan \left (d x + c\right )}{4 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.77, size = 193, normalized size = 1.87 \[ \frac {C\,b^2\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}+\frac {2\,A\,a\,b\,\sin \left (c+d\,x\right )}{d}+\frac {A\,a^2\,\cos \left (c+d\,x\right )\,\sin \left (c+d\,x\right )}{2\,d}-\frac {A\,a^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,1{}\mathrm {i}}{d}-\frac {A\,b^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}}{d}-\frac {C\,a^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}}{d}-\frac {C\,a\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,4{}\mathrm {i}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (A + C \sec ^{2}{\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right )^{2} \cos ^{2}{\left (c + d x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________